//  不要给我WA WA 叫
//  一定AC
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <iomanip>
#include <climits>
#define int long long 
using namespace std;
const int N = 1e5 + 10;
//int a[N];
int sum(const vector<int> &arr, int x,int y)
{
    int s = 0;
    for(auto num : arr)
    {
        s += min(abs(num - x), abs(num - y));
    }
    return s;
}
void solve()
{
     int n,l;
     cin >> n >> l;
     vector<int> arr(n);
     for(int i = 0; i < n; i++) arr[i] = i + 1;
     int minsum = INT_MAX;
     int x,y;
     for(int i = -200; i <= 100; i++)
     {
        int j = i + l;

            int s2 = sum(arr,i,j);
            if(s2 < minsum)
            {
                 minsum = s2;
                 x = i;
                 y = j;
            }
     }
     
     cout << x << " " << y << " " << minsum << endl;
}
signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    int t;
    cin >> t;
    while(t -- )  solve();
    return 0;
}

 